package com.cloudfun.campusshare.common.constant;

/**
 * @author : ashsr.zhang
 * @date : 2020/3/3 15:45
 * @Version : v1.0
 * @description 项目类型
 **/
public enum ProjectType {
    WASHING_MACHINE(0,"洗衣机"),
    HOT_WATER_SYSTEM(1,"热水系统"),
    HOT_WATER_MACHINE(2,"热水器"),
    AIR_CONDITIONING(3,"空调"),
    DRYING_MACHINE(4,"烘干机"),
    HAIR_DRYER(5,"吹风机"),
    WATER_DISPENSER(6,"饮水机");

    private Integer code;
    private String message;

    ProjectType(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static ProjectType getTypeByCode(Integer code){
        if(code == null){
            return null;
        }
        ProjectType[] values = ProjectType.values();
        for(ProjectType type:values){
            if(type.getCode().equals(code)){
                return type;
            }
        }
        return null;
    }
}
